import sys
import os
import gradio as gr
import core

def launch_gradio():
    try:
        iface = gr.ChatInterface(
            fn=core.chatqwen_chat,
            title="金融RAG问答机器人",
            chatbot=gr.Chatbot(height=500),
        )
        iface.launch(share=True, server_name="0.0.0.0")
    except Exception as e:
        print("出错了，错误信息是: ",e)
    

 


if __name__ == "__main__":
    # 启动 Gradio 服务
    launch_gradio()
